package app.contact;

import app.Numero.NumeroBureau;
import app.Numero.NumeroDomicile;
import app.Numero.NumeroPortable;
import app.mail.AdresseMail;
import app.mail.AdresseMailPro;


public class Professionnel extends Personne {
	private NumeroBureau numbur;
	private AdresseMailPro sonMailPro;


	public Professionnel(String nom, String prenom, String civilites,
			NumeroPortable numPort, NumeroDomicile numDom, String adresse,
			AdresseMail sonMail,NumeroBureau sonNumbur,AdresseMailPro MailPro) {
		super(nom, prenom, civilites, numPort, numDom, adresse, sonMail);
		this.numbur = sonNumbur;
		this.sonMailPro = MailPro;
	}

	public NumeroBureau getNumbur() {
		return numbur;
	}

	public void setNumbur(NumeroBureau numbur) {
		this.numbur = numbur;
	}

	public AdresseMailPro getSonMailPro() {
		return sonMailPro;
	}

	public void setSonMailPro(AdresseMailPro sonMailPro) {
		this.sonMailPro = sonMailPro;
	}

	@Override
	public String toString() {
		return "Professionnel ["+ this.toString2() +", numbur=" + numbur + ", sonMailPro=" + sonMailPro
				+ "]\n";

	}
	
	@Override
	public boolean equals(Object obj) {
		if (this.getClass().toString().equalsIgnoreCase(obj.getClass().toString())){
			if(this.getNom().equals(((Personne) obj).getNom()) && this.getPrenom().equals(((Personne) obj).getPrenom()) && this.getCivilites().equals(((Personne) obj).getCivilites()) && this.getNumPort() == (((Personne) obj).getNumPort()) && this.getNumDom() == (((Personne) obj).getNumDom()) && this.getAdresse().equals(((Personne) obj).getAdresse()) && (this.getSonMail().getLeMail()).equals(((Personne) obj).getSonMail().getLeMail()) && this.numbur.getNum().equals(((Professionnel) obj).getNumbur().getNum()) && this.sonMailPro.getLeMail().equals(((Professionnel) obj).getSonMailPro().getLeMail())) {
				return true;
			}
			else {
				return false;
			}
		}
		else {
			return false;
		}
	}
}
